package com.raycloud.robot.custom.zdfUtils.dto.basic;

import org.springframework.util.StringUtils;

public abstract class BasicZdfResponse{
    private int errorNo;
    private String errorMsg;
    private String requestId;
    public BasicZdfResponse(final int errorNo,final String errorMsg,final String requstId){
        this.errorNo=errorNo;
        this.errorMsg=errorMsg;
        this.requestId=requstId;
    }
    public BasicZdfResponse(){
    }
    public Boolean isSuccess(){
        return this.errorNo==0&&StringUtils.isEmpty(this.errorMsg);
    }
    public int getErrorNo(){
        return this.errorNo;
    }
    public String getErrorMsg(){
        return this.errorMsg;
    }
    public String getRequestId(){
        return this.requestId;
    }
    public void setErrorNo(final int errorNo){
        this.errorNo=errorNo;
    }
    public void setErrorMsg(final String errorMsg){
        this.errorMsg=errorMsg;
    }
    public void setRequestId(final String requestId){
        this.requestId=requestId;
    }
    @Override
    public boolean equals(final Object o){
        if(o==this){
            return true;
        }
        if(!(o instanceof BasicZdfResponse)){
            return false;
        }
        final BasicZdfResponse other=(BasicZdfResponse)o;
        if(!other.canEqual(this)){
            return false;
        }
        if(this.getErrorNo()!=other.getErrorNo()){
            return false;
        }
        final Object this$errorMsg=this.getErrorMsg();
        final Object other$errorMsg=other.getErrorMsg();
        Label_0078:{
            if(this$errorMsg==null){
                if(other$errorMsg==null){
                    break Label_0078;
                }
            }
            else if(this$errorMsg.equals(other$errorMsg)){
                break Label_0078;
            }
            return false;
        }
        final Object this$requestId=this.getRequestId();
        final Object other$requestId=other.getRequestId();
        if(this$requestId==null){
            if(other$requestId==null){
                return true;
            }
        }
        else if(this$requestId.equals(other$requestId)){
            return true;
        }
        return false;
    }
    protected boolean canEqual(final Object other){
        return other instanceof BasicZdfResponse;
    }
    @Override
    public int hashCode(){
        final int PRIME=59;
        int result=1;
        result=result*59+this.getErrorNo();
        final Object $errorMsg=this.getErrorMsg();
        result=result*59+(($errorMsg==null)?43:$errorMsg.hashCode());
        final Object $requestId=this.getRequestId();
        result=result*59+(($requestId==null)?43:$requestId.hashCode());
        return result;
    }
    @Override
    public String toString(){
        return "BasicZdfResponse(errorNo="+this.getErrorNo()+", errorMsg="+this.getErrorMsg()+", requestId="+this.getRequestId()+")";
    }
    public static class EmptyResp extends BasicZdfResponse{
        public EmptyResp(final int errorNo,final String errorMsg,final String requstId){
            super(errorNo,errorMsg,requstId);
        }
        @Override
        public boolean equals(final Object o){
            if(o==this){
                return true;
            }
            if(!(o instanceof EmptyResp)){
                return false;
            }
            final EmptyResp other=(EmptyResp)o;
            return other.canEqual(this);
        }
        @Override
        protected boolean canEqual(final Object other){
            return other instanceof EmptyResp;
        }
        @Override
        public int hashCode(){
            final int result=1;
            return 1;
        }
        @Override
        public String toString(){
            return "BasicZdfResponse.EmptyResp()";
        }
    }
}
